<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改模块|<{$configcache['Title']}></title>
<link rel="stylesheet" type="text/css" href="__CSS__/content.css"  />
<link rel="stylesheet" type="text/css" href="__CSS__/public.css"  />
<script type="text/javascript" src="__JS__/jquery.js"></script>
<script type="text/javascript" src="__JS__/Public.js"></script>
<script type="text/javascript" src="__JS__/winpop.js"></script>
<script type="text/javascript" src="__JS__/check.js"></script>
<script>
$(document).ready(function() {
	var $dldd=$('#dl dd');
	$('.button').click(function() {
		var 
			mname=$dldd.find('.qtext').eq(0).val(),			//模块名称
			sid=$dldd.find('.select').val(),				//目录
			img=$('input:hidden').eq(0).val(),					//菜单图标
			url=$dldd.find('.qtext').eq(1).val(),			//连接地址
			description=$dldd.find('.textarea').val(),		//描述
			msort=$dldd.find('.qtext').eq(2).val(),			//排序ID
			status=$dldd.find('.status:checked').val(),		//是否永久封禁
			id=$('#dl input:hidden').eq(-1).val();
			
		if (!tcheck(id,'','ID获取失败')) { return false; }
		if (!tcheck(id,'number','ID获取失败')) { return false; }
		if (!tcheck(mname,'','请填写正确的菜单名称')) { return false; }
		if (!tcheck(mname,'1,20','菜单名称请在20个字符以内','length')) { return false; }
		if (!tcheck(sid,'','目录ID获取失败')) { return false; }
		if (!tcheck(sid,'number','目录ID获取失败')) { return false; }
		if (!tcheck(msort,'','请填写排序ID')) { return false; }
		if (!tcheck(msort,'number','请填写正确的排序ID，必须是数字')) { return false; }
		if (!tcheck(status,'','状态ID获取失败')) { return false; }
		if (!tcheck(status,'number','状态ID获取失败')) { return false; }
		
		wintq('正在处理，请稍后...',4,20000,0,'');
		$.ajax({
			url:'__APP__/System/module_edit_do/',
			dataType:'json',
			type:'POST',
			data:'id='+id+'&mname='+mname+'&sid='+sid+'&img='+img+'&url='+url+'&description='+description+'&msort='+msort+'&status='+status,
			success: function(data) {
				if (data.s=='ok') {
					wintq('修改成功',1,1000,0,'__APP__/System/module_edit/id/'+id);
				}else {
					wintq(data.s,3,1000,1,'');
				}
			}
		});
	});
	$('#ximg').click(function() {
		window.top.c.window.Img();
	});
});
</script>
</head>
<body>
<div id="content">
	<dl id="dl">
    	<dt>修改模块信息</dt>
        <dd>
        	<span class="dd_left">模块名称：</span>
        	<span class="dd_right"><input type="text" name="mname" class="qtext" maxlength="20" value="<{$result.ModuleName}>" /><font>* 输入如：系统管理</font></span>
        </dd>
        <dd>
        	<span class="dd_left">上级目录：</span>
            <span class="dd_right">
            	<select name="sid" class="select" <if condition="$result['Sid'] eq 0">disabled</if>>
                    <option value="0">顶级目录</option>
                    <foreach name="list" item="l">
                    	<if condition="$result['Sid'] eq 0">
                        	<if condition="$l['Sid'] eq 0">
                            	<option value="<if condition="$result['ID'] eq $l['ID']">0<else /><{$l.ID}></if>" <if condition="$result['ID'] eq $l['ID']">selected</if>><if condition="$l.html neq ''">└</if><{$l.html}><{$l.ModuleName}></option>
                            <else />
                            	<option value="<{$l.ID}>" <if condition="$result['Sid'] eq $l['ID']">selected</if>><if condition="$l.html neq ''">└</if><{$l.html}><{$l.ModuleName}></option>
                            </if>
                        <else />
                        	<option value="<{$l.ID}>" <if condition="$result['Sid'] eq $l['ID']">selected</if>><if condition="$l.html neq ''">└</if><{$l.html}><{$l.ModuleName}></option>
                        </if>
                    </foreach>
                </select><font>* 选择模块目录</font>
            </span>
        </dd>
        <dd>
        	<span class="dd_left">模块图标：</span>
            <span class="dd_right">
            	<img src="<{$result.ModuleImg}>" height="26" id="mimg" /><div id="ximg">选择图标</div>
            </span>
        </dd><input type="hidden" id="img" value="<{$result.ModuleImg}>" />
        <dd>
        	<span class="dd_left">链接地址：</span>
        	<span class="dd_right"><input type="text" name="url" class="qtext" maxlength="50" value="<{$result.ModuleUrl}>" /><font>* 填写连接地址</font></span>
        </dd>
        <dd>
        	<span class="dd_left">描述说明：</span>
            <span class="dd_right"><textarea name="description" class="textarea"><{$result.Description}></textarea></span>
        </dd>
        <dd>
        	<span class="dd_left">排序ID：</span>
        	<span class="dd_right"><input type="text" name="sort" class="qtext" maxlength="10" value="<{$result.Msort}>" /><font>* 排序ID</font></span>
        </dd>
        <dd>
        	<span class="dd_left">状态：</span>
            <span class="dd_right"><label><input type="radio" name="status" class="status" value="0" <if condition="$result['Status'] eq 0">checked</if> /> 启用</label><label><input type="radio" name="status" class="status" value="1" <if condition="$result['Status'] eq 1">checked</if> /> 禁用</label></span>
        </dd><input type="hidden" value="<{$result['ID']}>" />
        <dd><input type="button" class="button" value="提 交" /></dd>
    </dl>
</div>
</body>
</html>
